package com.xpec.c4.db.model.log;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.xpec.c4.db.model.log.basic.BasicLogModel;
import com.xpec.c4.service.annotations.In;

/**
 * 账号登陆log， 注意，不同于角色登陆，此时玩家应该还没有选择角色。
 * @author Francois
 */
@Entity
@Table(name="account_login")
@org.hibernate.annotations.Table(
		appliesTo = "account_login", indexes = {
				@org.hibernate.annotations.Index(name = "IDX_COOP_ACCOUNT_ID", columnNames = { "cooperatorAccountId"})
		})
public class DBAccountLoginLog extends BasicLogModel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 872501264209328514L;

	/**
	 *账户登录时的ID
	 */
	private String accountId;

	/**
	 * 營運商accountID
	 */
	private String cooperatorAccountId;

	/**
	 *账户登录时客服端的IP
	 */
	@In
	private String clientIP;
	
	/**
	 * 平台id
	 */
	private int platformId;

	/**
	 * 連線裝置id
	 */
	private int deviceId;
	
	/**
	 * 營運商 id
	 */
	private String venderId;
	
	/**
	 * 子營運商 id
	 */
	private String subVenderId;

	public DBAccountLoginLog() {
		super();
	}
	
//	public DBAccountLoginLog (String accountId, String clientIP) {
//		super();
//		this.accountId = accountId;
//		this.clientIP = clientIP;
//	}
	
	public DBAccountLoginLog(String accountId, String clientIP, int platformId) {
		super();
		this.accountId = accountId;
		this.clientIP = clientIP;
		this.platformId = platformId;
	}

	public String getAccountId() {
		return accountId;
	}

	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}

	public String getClientIP() {
		return clientIP;
	}

	public void setClientIP(String clientIP) {
		this.clientIP = clientIP;
	}

	@Column(columnDefinition="int default 0")
	public int getPlatformId() {
		return platformId;
	}

	public void setPlatformId(int platformId) {
		this.platformId = platformId;
	}
	
	@Column(columnDefinition="int default 0")
	public int getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(int deviceId) {
		this.deviceId = deviceId;
	}

	public String getCooperatorAccountId() {
		return cooperatorAccountId;
	}

	public void setCooperatorAccountId(String cooperatorAccountId) {
		this.cooperatorAccountId = cooperatorAccountId;
	}
	
	@Column(columnDefinition="VARCHAR(50) NOT NULL default 'TONWA'")
	public String getVenderId() {
		return venderId;
	}

	public void setVenderId(String venderId) {
		this.venderId = venderId;
	}

	@Column(columnDefinition="VARCHAR(50) NOT NULL default 'TONWA'")
	public String getSubVenderId() {
		return subVenderId;
	}

	public void setSubVenderId(String subVenderId) {
		this.subVenderId = subVenderId;
	}
}
